package com.lawrence.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author wanglanglang
 */
@Controller
public class ControllerTest {
    /**
     * 映射访问路径
     */
    @GetMapping("/test")
    public String index(Model model) {
        //Spring MVC会自动实例化一个Model对象用于向视图中传值
        model.addAttribute("msg", "ControllerTest");
        System.out.println("...........");
        //返回视图位置
        return "test";
    }
}
